<?php print '<?xml version="1.0" encoding="UTF-8"?>'?>
<?php $baseUrl = $this->baseUrl()?>
<kml xmlns="http://www.opengis.net/kml/2.2"><Document>
<Style id="wetIconDefault">
	<IconStyle>
		<color>ff00ff00</color>
		<colorMode>random</colorMode>
		<scale>1</scale>
		<Icon>
			<href><?php print $baseUrl?>/images/<?php print CATALOG_TYPE ?>/gmap/default.png</href>
		</Icon>
	</IconStyle>
</Style>
<Style id="wetIconStandard">
	<IconStyle>
		<color>ff00ff00</color>
		<colorMode>random</colorMode>
		<scale>1</scale>
		<Icon>
			<href><?php print $baseUrl?>/images/<?php print CATALOG_TYPE ?>/gmap/standard.png</href>
		</Icon>
	</IconStyle>
</Style>
<Style id="wetIconMedium">
	<IconStyle>
		<color>ff00ff00</color>
		<colorMode>random</colorMode>
		<scale>1</scale>
		<Icon>
			<href><?php print $baseUrl?>/images/<?php print CATALOG_TYPE ?>/gmap/medium.png</href>
		</Icon>
	</IconStyle>
</Style>
<Style id="wetIconPremium">
	<IconStyle>
		<color>ff00ff00</color>
		<colorMode>random</colorMode>
		<scale>1</scale>
		<Icon>
			<href><?php print $baseUrl?>/images/<?php print CATALOG_TYPE ?>/gmap/premium.png</href>
		</Icon>
	</IconStyle>
</Style>
<?php foreach ($this->rowset as $row):?>
<Placemark>
	<name><?php print $row['name']?></name>
	<visibility>1 </visibility>
	<open>1</open>
	<address><?php print $this->escape($row['adress'])?></address>
	<description><![CDATA[
			<a href="<?php print $this->url(array('id' => $row['id']), 'catalog-show')?>" title="<?php print $this->escape($row['name']); ?>">
				<?php if (strlen($row['image'])):?>
					<img align="right" src="<?php print $baseUrl?>/upload/catalog/image/logo/<?php print $row['image']?>" alt="<?php print $this->escape($row['name']); ?>" />
				<?php else:?>
					<img align="right" src="<?php print $baseUrl?>/images/<?php print CATALOG_TYPE ?>/logo-small.png" alt="<?php print CATALOG_NAME ?>"/>
				<?php endif;?>
			</a>

			<p>
				<?php print $this->escape($row['adress'])?> <br/>
				<a href="<?php print $this->url(array('id' => $row['id']), 'catalog-show')?>#show_phone_number">Zobacz numer telefonu &raquo;</a> <br/><br/>
				<a style="color:green" href="<?php print $this->url(array('id' => $row['id']), 'catalog-show')?>"><?php print $this->url(array('id' => $row['id']), 'catalog-show')?></a>
			</p>

			<p>
				<a href="<?php print $this->url(array('id' => $row['id']), 'catalog-show')?>">Zobacz gdziny pracy</a> -
				
				<?php if ($row['catalog_promo_type_id'] == '3'):?>
					<a href="<?php print $this->url(array('id' => $row['id'],'tab'=>'uslugi'), 'catalog-show')?>">Usługi</a> -
					<a href="<?php print $this->url(array('id' => $row['id'],'tab'=>'personel'), 'catalog-show')?>">Personel</a> -
				<?php else:?>
					<a href="<?php print $this->url(array('id' => $row['id']), 'catalog-show')?>">Usługi</a> -
					<a href="<?php print $this->url(array('id' => $row['id']), 'catalog-show')?>">Personel</a> - 
				<?php endif;?>

				<a href="<?php print $this->url(array('id' => $row['id']), 'catalog-show')?>">Więcej &raquo;</a>
			</p>
	]]></description>
	<styleUrl>#<?php
		switch ($row['catalog_promo_type_id']) {
			case '3': print 'wetIconPremium'; break;
			case '2': print 'wetIconMedium'; break;
			case '1': print 'wetIconStandard'; break;
			default:  print 'wetIconDefault'; break;
		}?></styleUrl>
	<Point>
		<coordinates><?php print $row['lng']?>,<?php print $row['lat']?></coordinates>
	</Point>
</Placemark>
<?php endforeach;?>
</Document>
</kml>